Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Events #41

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Events #41

wants to merge 2 commits into from

Conversation

danielstjules
Copy link
Contributor

Continuation of #32

@danielstjules
Copy link
Contributor Author

danielstjules commented Jun 12, 2017

Works locally with latest chrome, but CI wasn't running with the previous PR, so let's see if this works in all browsers.

@danielstjules
Copy link
Contributor Author

@alvinlindstam Looks like the storage events don't quite behave as expected in IE

@alvinlindstam
Copy link

@danielstjules Ah, in what way? I'd be happy to assist in fixing it if possible.

@danielstjules
Copy link
Contributor Author

danielstjules commented Jun 15, 2017

@alvinlindstam Here's a link to the job associated with your original PR: https://travis-ci.org/zendesk/cross-storage/builds/242063000 The squashed commit is here: 360b896

IE in particular is firing more events than intended. I can probably test against a VM some time next week.

@alvinlindstam
Copy link

Ah, I guess it's related to the known issues mentioned on https://caniuse.com/#feat=namevalue-storage.

The "storage" event is completely wrong in IE:
IE10 : The storage event is fired even on the originating document where it occurred. Causes problems with multiple windows websites, and huge problems with iframes.
IE11 : The storage event's oldValue and newValue are identical (newValue is supposed to contain the storage's updated value).

Partial workaround: regularly probe the storage's value and compare with the last known value on all pages where you want to listen to this event, and track the last submitted value to determine if the modification was triggered locally.

Should we try to use their suggested workaround or document the bugs? The same issues would occur if using vanilla localStorage on the same host with IE.

The workaround would be more difficult to do on the client side however, so if it should be worked around it should probably be on the hub side. But continuously polling and storing all key-value-pairs in localstorage could be quite a performance issue (mainly memory) depending on the stored data.

@explunit
Copy link

explunit commented Sep 1, 2017

Is this feature still planned?

Regarding this:

continuously polling and storing all key-value-pairs in localstorage could be quite a performance issue (mainly memory) depending on the stored data.

Maybe this could be an opt-in feature so that this cost is not incurred unless you intend to use events?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants